from django.contrib import admin
from django.contrib.auth.models import User

from . import ShopperConfig
from .models import *
# Register your models here.
#admin.site.register(CartInfos)
#admin.site.register(OrderInfos)
@admin.register(CartInfos)
class CartInfosAdmin(admin.ModelAdmin):
    #设置在列表页显示的字段是id和quantity
    list_display = ['id','quantity']

@admin.register(OrderInfos)
class OrderInfosAdmin(admin.ModelAdmin):
    list_display = ['id','price','created','state']
    #按照state字段进行过滤
    list_filter = ['state']
    #设置按照created的日期字段进行层级导航
    date_hierarchy = 'created'